{% extends "base_layout.html" %}

{% block title %}Project List{% endblock %}

{% block content %}
<div class="box">
  <h2>
    Projects
  </h2>
  {% if message %}
  {{message}}
  {% endif %}
  <div id="pager">
    <!-- ${page.pager()} -->
  </div>
  <table>
    <thead>
      <tr>
        <th>Short Name</th>
        <th>Display Name</th>
      </tr>
    </thead>

    <!-- Need javascript to make the row clickable -->
    <tbody>
      {%- for row in list_data %}
      <tr class="{{ loop.cycle('odd', 'even') }}">
        <td><a href="{{ url_for('view_project', slug_name=row['slug_name']) }}">{{row['slug_name']}}</a></td>
        <td>{{row['name']}}</td>
      </tr>
      {%- endfor %}
    </tbody>
  </table>
  <div id="actions">
    <form action="{{url_for('new_project')}}" method="post" id="new_project">
      <input type="submit" name="_action_new" value="Add New Project" class="default" />
    </form>
  </div>
</div>
{% endblock %}
